<template>
	<div class="topall">
		<div class="li">HI,{{name}}</div>
		<div class="li lan" @click="tuichu">退出登录</div>
	</div>
</template>

<script>
	import axios from 'axios'
	import bus from '@/assets/bus.js'
	export default {
		name: 'index',
		data() {
			return {
				name:""
			}
		},
		watch: {
			// num:function(newValue, oldValue) {
			//   console.log(newValue, oldValue)
			// }
		},
		computed: {
			// zongjia:function(){
			//   return this.num * 100
			// }
		},
		created() {
			this.name = JSON.parse(localStorage.getItem('person')).realname
		},
		methods: {
			tuichu: function() {
				localStorage.clear('token')
				setTimeout(() => {
					this.$router.push({
						path: '/login'
					})
				}, 500)
			}
		},

	}
</script>

<style scoped lang="less">
	.topall {
		display: flex;
		background: #FFFFFF;
		justify-content: flex-end;
		padding: 10px;
		box-shadow: 2px 0 5px #2D3038;

		.li {
			margin-right: 20px;
		}

		.lan {
			cursor: pointer;
		}
	}
</style>
